#ifndef _TRACKBALL_INTERACTION_H
#define _TRACKBALL_INTERACTION_H

class trackBallInteraction
{
public:
	trackBallInteraction();

public: //interaction
	void 	OnMouseMove (float x, float y);
	void 	OnLeftButtonDown (float x, float y);
	void 	OnLeftButtonUp (float x, float y);
	void 	OnMiddleButtonDown (float x, float y);
	void 	OnMiddleButtonUp (float x, float y);
	void 	OnRightButtonDown (float x, float y);
	void 	OnRightButtonUp (float x, float y);

public:
	//status check
	bool IsLeftButtonDown();
	bool IsMiddleButtonDown();
	bool IsRightButtonDown();
	void GetRotationMatrix(float mat[]);
	float* GetRotationMatrixPointer();
	void GetTranslationVector(float vec[]);
	float* GetTranslationVectorPointer();

private:
	float _rotMat[16];
	float _transVec[3];

	float p1x, p1y;
	float p2x, p2y;
	//button status
	bool _isLdown, _isMdown, _isRdown;//correspoinding to the L M R mouse button

	//temp
	float q[4];
	float deltaq[4];
	float Rotm[4][4];
	float Rotm1D[16];
	float lastZ, lastX, lastY;


};


#endif 
